-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL][Sema] Only imply float size conversion warnings in SYCL #16857
[SYCL][Sema] Only imply float size conversion warnings in SYCL #16857
Conversation
Before this change `-Wimplicit-float-conversion` (part of `-Wconversion`) enabled `-Wimplicit-float-size-conversion` for all language modes. This is problematic because it causes it makes DPC++ emit warnings where upstream clang does not, even when used as a plain C++ compiler. Projects that enable `-Werror` don't expect these (questionable) floating point size warnings when they enable `-Wconversion`, and as such cannot be compiled with the DPC++ compiler. Change `-Wimplicit-float-conversion` to imply `-Wsycl-implicit-float-size-conversion` instead, which is only emitted in SYCL language mode. This preserves existing behaviour for SYCL users. Explicitly passing `-Wimplicit-float-size-conversion` still applies to all language modes. This change only affects users who enable `-Wimplicit-float-conversion` but do not enable `-Wimplicit-float-size-conversion` explicitly and do not compile in SYCL language mode. These users would need to enable the option explicitly to keep the existing behaviour.
@intel/dpcpp-cfe-reviewers please review :) |
- Only emit `-Wimplicit-float-size-conversion` warnings in SYCL language mode - Remove `-Wsycl-implicit-float-size-conversion` - Revert changes to llvm community tests - Update tests
Simplified the logic now |
I apologize for the delay in review. I was OOO sick last week and am still working on and off now. I think changing the name to include sycl makes sense since this is now a SYCL only warning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving the patch since the remaining review comment is more of a nit and not a functional change.
I believe the CI failures are unrelated: |
@intel/llvm-gatekeepers please merge :) |
Before this change
-Wimplicit-float-conversion
(part of-Wconversion
) enabled-Wimplicit-float-size-conversion
for all language modes.This is problematic because it causes DPC++ to emit warnings where upstream clang does not, even when used as a plain C++ compiler. Projects that enable
-Werror
don't expect these (questionable) floating point size warnings when they enable-Wconversion
, and as such cannot be compiled with the DPC++ compiler.Change
-Wimplicit-float-conversion
to only be emitted in SYCL language mode and rename it to-Wsycl-implicit-float-conversion
. This preserves existing behaviour for SYCL users, but otherwise matches upstream Clang behaviour.Fixes: #16393